package com.lkd.service.impl;


import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.lkd.entity.Partner;
import com.lkd.mapper.PartnerMapper;
import com.lkd.service.PartnerService;
import com.lkd.vo.PageBean;
import com.lkd.vo.PartnerVo;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 合作商表 服务实现类
 * </p>
 *
 * @author 聂德祥
 * @since 2024-08-19
 */
@Service
public class PartnerServiceImpl extends ServiceImpl<PartnerMapper, Partner> implements PartnerService {

    @Override
    public PageBean<PartnerVo> findByPage(String name, Integer pageIndex, Integer pageSize) {
        Page<PartnerVo> partnerVoPage = new Page<>(pageIndex,pageSize);
        partnerVoPage =  getBaseMapper().findByPage(partnerVoPage,name);
        return new PageBean<PartnerVo>(partnerVoPage);
    }

    @Override
    public Partner getPartnerById(Integer id) {
        return getPartnerById(id);
    }

    @Override
    public Integer getCount() {
        return getBaseMapper().getCount();
    }
}
